﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%> 

<%
String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品信息</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="js/select-ui.min.js"></script>
<script type="text/javascript" src="js/kindeditor.js"></script>
<style type="text/css">
.up_icon,.up_input {
	position: absolute;
	top: 10px;
	left: 10px;
	width: 64px;
	height: 64px;
	z-index: 2
}
.up_icon {
	overflow: hidden;
	font-size: 0;
	line-height: 99em;
	background:
		url(http://sfault-image.b0.upaiyun.com/346/967/3469672357-54250d7235406_articlex)
		no-repeat 0 0;
	z-index: 1;
}
.textarea1{
	-moz-box-shadow:1px 1px 0 #E7E7E7;
	-moz-box-sizing:border-box;
	border-color:#CCCCCC #999999 #999999 #CCCCCC;
	border-style:solid;
	border-width:1px;
	font-family:arial,sans-serif;
	font-size:13px;
	height:130px;
	margin:10px auto;
	margin-left:85px;
	outline-color:-moz-use-text-color;
	outline-style:none;
	outline-width:medium;
	padding:2px;
	width:80%;
}
</style>
<script type="text/javascript">
	KE.show({
		id : 'content7',
		cssPath : './index.css'
	});
</script>
<script type="text/javascript">
	$(document).ready(function(e) {
		$(".select1").uedSelect({
			width : 345
		});
		$(".select2").uedSelect({
			width : 167
		});
		$(".select3").uedSelect({
			width : 100
		});
	});
	function checked(){
		if($("form").attr("action")=="/vshlh/goods_addGoods.action"){
			var flag = 0;
			$(".flag").each(function(){
				if($(this).attr("value") != 0){
				   flag = 1;
				}	
			});
			if(flag == 1){
				return true;
			}
			return false;
		}
		return true;
	}
	function fileChange(obj,value){
		 if($($(obj).parent()).prev().attr("value")== 0){
			$($(obj).parent()).prev().attr("value",value);
		}else{
			$($(obj).parent()).prev().attr("value",0);
		} 
	}
	
</script>
</head>
<body
	style="background:url(img/top.jpg) repeat-x;"
	height="100%">
	<div class="formbody">
		<div id="usual1" class="usual">
			<div class="itab">
				<ul>
					<center>
						<li><a href="#tab1" style="color:white;">添加商品</a>
						</li>
					</center>
				</ul>
			</div>
			<form action="<%=request.getContextPath()%>/goodsController/${ empty goods?'saveGoods':'editGoods' }.action" method="post"
				 enctype="multipart/form-data">
				<input type="hidden" name ="goods_id" value="${goods.goods_id }"/>
					<input type="hidden" name = "pid" value="${pid }"/>
					<input type="hidden" name="goods_pid" value="${goods.goods_pid }"/>
				<div id="tab1" class="tabson">
					<ul class="forminfo">
					
						<li><label>商品名称<b>*</b> </label> 
							<input name="goods_name" class="dfinput" value="${goods.goods_name }"/>
						</li>
						<li><label>商品描述<b>*</b> </label> 
							<textarea name="goods_shortDescription" class="textarea1" >
								 ${goods.goods_shortDescription }
							</textarea>
						</li>
						<li><label>商品价格<b>*</b> </label> 
							<input name="goods_price" class="dfinput" value="${goods.goods_price }"/>
						</li>
						<li><label>商品状态<b>*</b> </label> 
							<input name="goods_status" class="dfinput" value="${goods.goods_status }"/>
						</li>
						<li><label>商品规格<b>*</b> </label> 
							<input name="goods_norms" class="dfinput" value="${goods.goods_norms }"/>
						</li>
						<li><label>商品积分<b>*</b> </label> 
							<input name="goods_points" class="dfinput" value="${goods.goods_points }"/>
						</li>
						<li><label>商品活动<b>*</b> </label> 
							<input name="goods_active" class="dfinput" value="${goods.goods_active }"/>
						</li>
						<c:if test="${empty goods }">
						<li style="margin-top:20px;">
							<label>商品图片<b>*</b></label>
								<input type="file" class="file" label="上传" theme="simple" name="file1"  />
							</li>
						<input type="hidden" class="flag" name="flag" value="0"/>
						<li style="margin-top:20px;">
							<label>商品图片<b>*</b> </label>
								<input type="file" class="file" label="上传" theme="simple" name="file2"  />
						</li>
						<input type="hidden" class="flag" name="flag" value="0"/>
						<li style="margin-top:20px;">
							<label>商品图片<b>*</b> </label>
								<input type="file" class="file" label="上传" theme="simple" name="file3"  />
						</li>
						<input type="hidden" class="flag" name="flag" value="0"/>
						<li style="margin-top:20px;">
							<label>商品图片<b>*</b> </label>
								<input type="file" class="file" label="上传" theme="simple" name="file4"  />
						</li>
						</c:if>
						<li><label>&nbsp;</label><input name="" type="submit"
							class="btn" value="确定保存" />
						</li>
					</ul>
				</div>
			</form>
			<div id="tab1" class="tabson1">
				<div class="tableft">
					<img src="img/eg1.JPG" style="width:300px;height:400px"><br/>
					<p class="font">(样例大图 300px * 400px,正反两张)</p>
				</div>
				<div class="tabright">
					<img src="img/eg1.JPG" style="width:150px;height:190px;margin-bottom:20px;"><br/>
					<img src="img/eg1.JPG" style="width:150px;height:190px"><br/>
					<p class="font">(样例小图 300px * 400px,正反两张)</p>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$("#usual1 ul").idTabs();
	</script>
	<script type="text/javascript">
		$('.tablelist tbody tr:odd').addClass('odd');
	</script>
	</div>
</body>
</html>
